<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{mmItemGroupLevelBean.id}"/>
		<f:event type="preRenderView" listener="#{mmItemGroupLevelBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Mm Item Group Level"/>

	<ui:define name="header">
		Mm Item Group Level
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty mmItemGroupLevelBean.id}">
				Edit existing Mm Item Group Level
			</c:when>
			<c:otherwise>
				Create a new Mm Item Group Level
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelNo" value="Item Group Level No:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelNo" required="true" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelNo}"/>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelCode" value="Item Group Level Code:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelCode" maxLength="50" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelCode}"/>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelDescr" value="Item Group Level Descr:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelDescr" maxLength="300" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelDescr}"/>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelDescr" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelOrderByNo" value="Item Group Level Order By No:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelOrderByNo" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelOrderByNo}"/>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelOrderByNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelEffectiveDate" value="Item Group Level Effective Date:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelEffectiveDate" maxLength="10" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelEffectiveDate}">
						<f:convertDateTime type="date"/>
					</h:inputText>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelEffectiveDate" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelExpireDate" value="Item Group Level Expire Date:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelExpireDate" maxLength="10" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelExpireDate}">
						<f:convertDateTime type="date"/>
					</h:inputText>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelExpireDate" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelIsActive" value="Item Group Level Is Active:"/>
				<h:panelGroup>
					<h:inputText id="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelIsActive" value="#{mmItemGroupLevelBean.mmItemGroupLevel.itemGroupLevelIsActive}"/>
					<h:message for="mmItemGroupLevelBeanMmItemGroupLevelItemGroupLevelIsActive" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="mmItemGroupLevelBeanMmItemGroupLevelMmItemGroups" value="Mm Item Groups:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{mmItemGroupLevelBean.mmItemGroupLevel.mmItemGroups}"/>
					<h:dataTable id="mmItemGroupLevelBeanMmItemGroupLevelMmItemGroups" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Item Group No"/>
							</f:facet>
							<h:link outcome="/mmItemGroup/view">
								<f:param name="id" value="#{_item.itemGroupNo}"/>
								<h:outputText id="itemItemGroupNo" value="#{_item.itemGroupNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="mmItemGroupBeanAddItemGroupNo" value="#{mmItemGroupBean.add.itemGroupNo}"/>
								<h:message for="mmItemGroupBeanAddItemGroupNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(mmItemGroupBean.added)}" id="mmItemGroupLevelBeanMmItemGroupLevelMmItemGroupsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{mmItemGroupBean.add.mmItemGroupLevel}" value="#{mmItemGroupLevelBean.mmItemGroupLevel}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{mmItemGroupLevelBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty mmItemGroupLevelBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{mmItemGroupLevelBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{mmItemGroupLevelBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>